﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Web.master" AutoEventWireup="true"
    EnableEventValidation="false" CodeFile="DeptManager.aspx.cs" Inherits="Platform_DeptManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="../Scripts/validform.js" type="text/javascript"></script>
    <script src="../Scripts/YJPopup.js" type="text/javascript"></script>
    <script src="../Scripts/GiveTip.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $.checkForm();
        })
        var MyPopup;
        $(document).ready(function () {
            MyPopup = new YJPopup({
                contentDivID: "NsContentDiv",
                dragBarDivID: "NsDragBar",
                dragable: true,
                autoCreate: true
            })
        });
        function ShowUpdatePopup(ID) {
            MyPopup.Show("500px", "100px", "修改", "DeptModify.aspx?ID=" + encodeURIComponent(ID) + "&_" + Math.random());
        }
        function ClosePopup() {
            MyPopup.Hide();
            MyPopup.dragable = false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table class="tabContent">
        <tr>
            <th lang="th">
                部门添加
            </th>
        </tr>
        <tr>
            <td lang='td'>
                <table style="border-collapse: separate" cellpadding="2">
                    <tr>
                        <td>
                            名称：
                        </td>
                        <td>
                            <NC:FTextBox ID="txtDeptName" runat="server" CheckGroup="Add"></NC:FTextBox>
                        </td>
                        <td>
                            排序：
                        </td>
                        <td>
                            <NC:FTextBox ID="txtOrderID" Width="50px" runat="server" Text="0" CheckGroup="Add"
                                CheckType="Int" />
                        </td>
                        <td>
                            <asp:Button ID="Button1" class="btn" CheckGroup="Add" runat="server" OnClick="LBAdd_Click"
                                Text="添加" />
                            <asp:Button ID="btnBindData" runat="server" Text="更新" uncheck="true" CssClass="hidden"
                                OnClick="btnBindData_Click" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <th colspan="4" lang="th">
                部门列表
            </th>
        </tr>
        <tr>
            <td lang="td">
                <NC:FGridView ID="FGridView1" runat="server" AutoCreateNumber="true" ShowFooter="true"
                    DataKeyNames="DeptID" Width="500px">
                    <Columns>
                        <asp:BoundField DataField="DeptName" HeaderText="名称" />
                        <asp:BoundField DataField="OrderID" HeaderText="排序" ItemStyle-Width="60px" />
                        <asp:TemplateField HeaderText="操作" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
                            <ItemTemplate>
                                <input type="button" class="Gridbtn" value="修改" id="UpdateButton" onclick="ShowUpdatePopup(<%# Eval("DeptID") %>);">
                                <asp:Button runat="server" class="Gridbtn" Text="删除" ID="DelButton" uncheck="true"
                                    OnClientClick="GiveTip(event,'您确定删除吗？');" OnClick="DelButton_Click" CommandArgument='<%# Eval("DeptID") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </NC:FGridView>
            </td>
        </tr>
    </table>
</asp:Content>
